Skip to content

chore(changelog-check): exclude private packages from changelog check#68

Merged
cryptodev-2s merged 2 commits into
mainfrom
feat/exclude-private-packages
May 5, 2025
Merged

chore(changelog-check): exclude private packages from changelog check#68
cryptodev-2s merged 2 commits into
mainfrom
feat/exclude-private-packages

Conversation

@cryptodev-2s
Copy link
Copy Markdown
Contributor

@cryptodev-2s cryptodev-2s commented May 5, 2025

Description

This PR adds support for excluding private packages from the changelog check workflow. Private packages in a monorepo typically don't require public changelog entries since they are not published to npm.

Changes

  • Added isPrivatePackage function to detect private packages by checking the private field in package.json
  • Added caching for private package checks to optimize performance when multiple files in the same package are changed
  • Modified getChangedPackages to skip private packages regardless of which files were changed
  • Added logging when private packages are skipped for better visibility

Testing Steps

  1. Using Core monorepo:

    • First, make the phishing-controller package private by adding "private": true to its package.json
    • Make dummy changes to packages/phishing-controller/src/PhishingController.ts:
      // Add a dummy comment or empty line to trigger changes
      // This is a test change for private package changelog check
    • Commit the changes
  2. Test with current main version (should fail):

    # Manually copy the current changelog check script
    cp .github/workflows/changelog-check.ts (from github-tools) scripts/ (to core)
    
    # Update the execa import
    sed -i '' 's/import { execa }/import execa/' scripts/changelog-check.ts
    
    # Manually add the following to package.json under the scripts section:
    # "changelog:check": "ts-node scripts/changelog-check.ts"
    
    # Run the check
    yarn changelog:check . main 5690
    # This should fail, requiring a changelog for the private package
  3. Test with new version (should pass):

    # Manually copy the updated changelog check script
    cp .github/workflows/changelog-check.ts (from github-tools) scripts/ (to core)
    
    # Update the execa import
    sed -i '' 's/import { execa }/import execa/' scripts/changelog-check.ts
    
    # Run the check
    yarn changelog:check . main 5690
    # This should pass, skipping the private package without requiring a changelog

Expected Results:

  • Current version: Fails, requiring changelog for private package
  • New version: Passes, skipping private package changelog requirement

@cryptodev-2s cryptodev-2s self-assigned this May 5, 2025
@cryptodev-2s cryptodev-2s force-pushed the feat/exclude-private-packages branch from 4c6c1e1 to 67434c1 Compare May 5, 2025 21:08
@cryptodev-2s cryptodev-2s force-pushed the feat/exclude-private-packages branch from 67434c1 to b74ab88 Compare May 5, 2025 21:10
Comment thread src/changelog-check.ts Outdated
Comment thread src/changelog-check.ts Outdated
@cryptodev-2s cryptodev-2s requested a review from rekmarks May 5, 2025 21:28
Copy link
Copy Markdown
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cryptodev-2s cryptodev-2s merged commit 85fffce into main May 5, 2025
18 checks passed
@cryptodev-2s cryptodev-2s deleted the feat/exclude-private-packages branch May 5, 2025 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants